//
//  IndexMarketCell.m
//  YunFu
//
//  Created by Bager on 2018/8/31.
//  Copyright © 2018年 yunfu. All rights reserved.
//

#import "IndexMarketCell.h"

@implementation IndexMarketCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setViews];
    }
    return self;
}

- (void)setViews
{
    [self addSubview:self.img];
    [self addSubview:self.imgO];
    [self addSubview:self.name];
    [self addSubview:self.detail];
}

- (UIImageView *)img
{
    if (!_img)
    {
        _img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 32, (kScreenWidth - kPublicMargin * 2) / 4, 68)];
        _img.contentMode = UIViewContentModeScaleAspectFit;
        _img.layer.masksToBounds = YES;
    }
    return _img;
}

- (UIImageView *)imgO
{
    if (!_imgO)
    {
        _imgO = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.img.frame), CGRectGetMinY(self.img.frame), CGRectGetWidth(self.img.frame), 68)];
        _imgO.contentMode = UIViewContentModeScaleAspectFit;
        _imgO.layer.masksToBounds = YES;
    }
    return _imgO;
}


- (UILabel *)name
{
    if (!_name)
    {
        _name = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, (kScreenWidth - kPublicMargin * 2) / 2.0 - 20, 20)];
        _name.adjustsFontSizeToFitWidth = YES;
        _name.font = [UIFont systemFontOfSize:12];
        _name.textColor = [UIColor grayColor];
    }
    return _name;
}

- (UILabel *)detail
{
    if (!_detail)
    {
        _detail = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.name.frame), CGRectGetWidth(self.name.frame), 12)];
        _detail.adjustsFontSizeToFitWidth = YES;
        _detail.font = [UIFont systemFontOfSize:10];
        _detail.textColor = [UIColor grayColor];
    }
    return _detail;
}

@end
